/*
 * @Descripttion: 
 * @version: 
 * @Author: cyj
 * @Date: 2023-03-24 15:48:16
 */

const express = require('express')

const router = express.Router()

//导入token中间件jwt
const jwts = require('../dao/jwt')

const indexRouter = require('../router_handle/index')


//获取首页好友用户数据
router.get('/getUserList', (req, res) => {
    let data = req.query
    indexRouter.getUsers(data, res)
})

//把一对一聊天未读变为已读
router.post('/upateMsg', (req, res) => {
    let data = req.body
    indexRouter.updateMsg(data, res)
})

//获取群列表
router.get('/getGroupList', (req, res) => {
    let data = req.query;
    indexRouter.getGroup(data, res)
})


//将某个用户查看群消息的未读信息置为0
router.post('/updateGroupMsg', (req, res) => {
    let data = req.body
    indexRouter.updateGroupMsg(data, res)
})





module.exports = router